home *** CD-ROM | disk | FTP | other *** search
- package views
- {
- import events.NavigationEvent;
- import events.ScreenEvent;
- import flash.events.Event;
- import flash.events.MouseEvent;
- import flash.utils.getDefinitionByName;
- import mx.binding.Binding;
- import mx.binding.IWatcherSetupUtil;
- import mx.containers.Canvas;
- import mx.controls.Button;
- import mx.controls.Image;
- import mx.core.UIComponentDescriptor;
- import mx.core.mx_internal;
- import mx.events.PropertyChangeEvent;
-
- public class TopNav extends Canvas
- {
- private static var _watcherSetupUtil:IWatcherSetupUtil;
-
- private var _bindings:Array;
-
- [Bindable]
- private var _607087477_Image1:Image;
-
- public var _bindingsByDestination:Object;
-
- public var _bindingsBeginWithWord:Object;
-
- private var logoClass:Class;
-
- [Bindable]
- private var _1092797764closeBtn:Button;
-
- [Bindable]
- private var _1551636857demoBtn:Button;
-
- private var _watchers:Array;
-
- [Bindable]
- private var _975152270browseBtn:Button;
-
- [Bindable]
- private var _1778179988searchBtn:Button;
-
- private var _documentDescriptor_:UIComponentDescriptor;
-
- public function TopNav()
- {
- _documentDescriptor_ = new UIComponentDescriptor({
- "type":Canvas,
- "propertiesFactory":function():Object
- {
- return {
- "width":1280,
- "height":45,
- "childDescriptors":[new UIComponentDescriptor({
- "type":Button,
- "id":"searchBtn",
- "events":{"click":"__searchBtn_click"},
- "propertiesFactory":function():Object
- {
- return {
- "buttonMode":true,
- "styleName":"topNavBtn",
- "label":"Search",
- "x":56,
- "y":9,
- "height":36
- };
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"demoBtn",
- "events":{"click":"__demoBtn_click"},
- "propertiesFactory":function():Object
- {
- return {
- "buttonMode":true,
- "styleName":"topNavBtn",
- "label":"Demo",
- "x":328,
- "y":9,
- "height":36
- };
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"browseBtn",
- "events":{"click":"__browseBtn_click"},
- "propertiesFactory":function():Object
- {
- return {
- "buttonMode":true,
- "styleName":"topNavBtn",
- "label":"Browse by Cover",
- "x":561,
- "y":9,
- "width":158,
- "height":36
- };
- }
- }),new UIComponentDescriptor({
- "type":Image,
- "id":"_Image1",
- "propertiesFactory":function():Object
- {
- return {
- "x":1065,
- "y":10
- };
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"closeBtn",
- "events":{"click":"__closeBtn_click"},
- "propertiesFactory":function():Object
- {
- return {
- "buttonMode":true,
- "styleName":"closeBtn",
- "label":"X",
- "x":1230,
- "y":9,
- "width":27,
- "height":25
- };
- }
- })]
- };
- }
- });
- logoClass = TopNav_logoClass;
- super();
- mx_internal::_document = this;
- this.styleName = "topNav";
- this.width = 1280;
- this.height = 45;
- }
-
- public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
- {
- TopNav._watcherSetupUtil = param1;
- }
-
- private function _TopNav_bindingsSetup() : void
- {
- var binding:Binding = null;
- if(!_bindings)
- {
- _bindings = [];
- }
- if(!_watchers)
- {
- _watchers = [];
- }
- binding = new Binding(this,function():Object
- {
- return logoClass;
- },function(param1:Object):void
- {
- _Image1.source = param1;
- },"_Image1.source");
- _bindings[0] = binding;
- }
-
- private function clickHandler(param1:Event) : void
- {
- switch(param1.target)
- {
- case closeBtn:
- trace("sending quit " + this);
- dispatchEvent(new Event(ScreenEvent.QUIT,true));
- break;
- case searchBtn:
- dispatchEvent(new NavigationEvent(NavigationEvent.SEARCH_TAB,null,true));
- break;
- case browseBtn:
- dispatchEvent(new NavigationEvent(NavigationEvent.BROWSE_BY_COVER,null,true));
- break;
- case demoBtn:
- dispatchEvent(new NavigationEvent(NavigationEvent.DEMO,null,true));
- }
- }
-
- public function __searchBtn_click(param1:MouseEvent) : void
- {
- clickHandler(param1);
- }
-
- [Bindable(event="propertyChange")]
- public function get closeBtn() : Button
- {
- return this._1092797764closeBtn;
- }
-
- [Bindable(event="propertyChange")]
- public function get demoBtn() : Button
- {
- return this._1551636857demoBtn;
- }
-
- public function set closeBtn(param1:Button) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1092797764closeBtn;
- if(_loc2_ !== param1)
- {
- this._1092797764closeBtn = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"closeBtn",_loc2_,param1));
- }
- }
-
- public function __closeBtn_click(param1:MouseEvent) : void
- {
- clickHandler(param1);
- }
-
- public function __browseBtn_click(param1:MouseEvent) : void
- {
- clickHandler(param1);
- }
-
- public function set browseBtn(param1:Button) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._975152270browseBtn;
- if(_loc2_ !== param1)
- {
- this._975152270browseBtn = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"browseBtn",_loc2_,param1));
- }
- }
-
- public function set demoBtn(param1:Button) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1551636857demoBtn;
- if(_loc2_ !== param1)
- {
- this._1551636857demoBtn = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"demoBtn",_loc2_,param1));
- }
- }
-
- public function set _Image1(param1:Image) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._607087477_Image1;
- if(_loc2_ !== param1)
- {
- this._607087477_Image1 = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Image1",_loc2_,param1));
- }
- }
-
- public function set searchBtn(param1:Button) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1778179988searchBtn;
- if(_loc2_ !== param1)
- {
- this._1778179988searchBtn = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"searchBtn",_loc2_,param1));
- }
- }
-
- public function __demoBtn_click(param1:MouseEvent) : void
- {
- clickHandler(param1);
- }
-
- [Bindable(event="propertyChange")]
- public function get browseBtn() : Button
- {
- return this._975152270browseBtn;
- }
-
- override public function initialize() : void
- {
- var target:TopNav = null;
- var watcherSetupUtilClass:Object = null;
- mx_internal::setDocumentDescriptor(_documentDescriptor_);
- _TopNav_bindingsSetup();
- target = this;
- if(_watcherSetupUtil == null)
- {
- watcherSetupUtilClass = getDefinitionByName("_views_TopNavWatcherSetupUtil");
- watcherSetupUtilClass["init"](null);
- }
- _watcherSetupUtil.setup(this,function(param1:String):*
- {
- return target[param1];
- },_bindings,_watchers);
- super.initialize();
- }
-
- [Bindable(event="propertyChange")]
- public function get _Image1() : Image
- {
- return this._607087477_Image1;
- }
-
- [Bindable(event="propertyChange")]
- public function get searchBtn() : Button
- {
- return this._1778179988searchBtn;
- }
-
- private function _TopNav_bindingExprs() : void
- {
- var _loc1_:* = undefined;
- _loc1_ = logoClass;
- }
- }
- }
-
-